package com.mtons.mblog;

import com.mtons.mblog.base.oauth.OauthBaidu;
import lombok.extern.slf4j.Slf4j;
import okio.Source;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ApplicationContext;

/**
 * SprintBootApplication
 *
 *
 *  集成帆软报表是增加 ： extends SpringBootServletInitializer
 *
 *  集成帆软报表是增加 ：
 *   @Override
 *     protected SpringApplicationBuilder configure (SpringApplicationBuilder builder){
 *         return builder.sources(BootApplication.class);
 *     }
 */
@Slf4j
@SpringBootApplication
@EnableCaching
public class BootApplication extends SpringBootServletInitializer {
    private static final Logger logger = LoggerFactory.getLogger(BootApplication.class);

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(BootApplication.class, args);
        String serverPort = context.getEnvironment().getProperty("server.port");
        logger.info("mblog started at http://localhost:" + serverPort);
    }



    // 集成帆软报表是增加
    @Override
    protected SpringApplicationBuilder configure (SpringApplicationBuilder builder){
        return builder.sources(BootApplication.class);
    }



}